
#include <SFML/Graphics.hpp>
#include "Collision2.h"


Collision2::Collision2(void)
{
}


Collision2::~Collision2(void)
{
}

// Basic collision detection (Detects ship in transparent area - BAD)
// Check positions, widths and heights of two sprites and compare them
bool Collision2::checkCollision(sf::Sprite& sprite1, sf::Sprite& sprite2) {
	if(sprite1.getPosition().x  + sprite1.getScale().x > sprite2.getPosition().x && 
		sprite1.getPosition().x < sprite2.getPosition().x + sprite2.getScale().x && 
		sprite1.getPosition().y + sprite1.getScale().y > sprite2.getPosition().y && 
		sprite1.getPosition().y < sprite2.getPosition().y + sprite2.getScale().y) {
		return true;
	} else {
		return false;
	}
}
